package com.hitqz.robot.driver.netty.handler;

import com.hitqz.robot.driver.communication.NetworkServiceThreadPool;
import com.hitqz.robot.driver.dto.robot.SerialPortMessageDto;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * @author xupkun
 * @date 2023/8/4
 */
@Slf4j
@Component
public class M518RHandler {

    @EventListener
    protected void channelRead0(SerialPortMessageDto message)  {
       if (!Objects.equals(message.getServerName(),"M518R")){
           return;
       }
        NetworkServiceThreadPool.dealMessage(()->{
            //解析消息

        });

    }


}
